package com.fresh.bus.chat.domain;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

public class Water {
	//-2 保留数值，表示体力不足
	public static final int HURT = -5;
	public static final int NOTHING = -1;
	public static final int RESTORE = 0;
	public static final int JINGSHUI = 1;
	public static final int HESHUI = 2;
	public static final int YUSHUI = 3;
	public static final int LUSHUI = 4;
	public static final int SHANQUAN = 5;

	public static int getWater(int period, int weather) {
		List<Integer> list = new ArrayList<Integer>();
		list.add(Water.JINGSHUI);
		list.add(Water.HESHUI);
		if (period == Period.QINGCHEN
				&& (weather == Weather.QING || weather == Weather.DUOYUN)) {
			list.add(Water.LUSHUI);
		}
		if (weather == Weather.XIAOYU) {
			list.add(Water.YUSHUI);
		}

		int index = (int) (Math.random() * list.size());
		int result = list.get(index);
		int v = (int) (Math.random() * 99);
		if (v < 1)
			result = Water.SHANQUAN;
		return result;
	}

	public static int findPlantValue(int waterType) {
		int v = 0;
		switch (waterType) {
		case Water.JINGSHUI:
			v = 5;
			break;
		case Water.HESHUI:
			v = 10;
			break;
		case Water.LUSHUI:
			v = 20;
			break;
		case Water.YUSHUI:
			v = 40;
			break;
		case Water.SHANQUAN:
			v = 80;
			break;
		default:
			break;
		}
		return v;
	}
}
